package task02;

import java.util.*;

public class MyArrayList<T extends Object> {

    private List<T> arrayData;

    public MyArrayList() {
        arrayData = new ArrayList<T>();
    }

    public MyArrayList(List<T> arrayData) {
        this.arrayData = new ArrayList<T>();
        this.arrayData.addAll(arrayData);
    }

    public MyArrayList(T[] arrayData) {
        this.arrayData = new ArrayList<T>();
        this.arrayData.addAll(Arrays.asList(arrayData));
    }

    public int size() {
        return arrayData.size();
    }

    public int indexOf(T o) {
        return arrayData.indexOf(o);
    }

    public boolean contains(T o) {
        return arrayData.contains(o);
    }

    public boolean isEmpty() {
        return arrayData.isEmpty();
    }

    public T[] toArray() {
        return (T[]) arrayData.toArray();
    }

    public T get(int index) {
        return arrayData.get(index);
    }

    public T set(int index, T element) {
        return arrayData.set(index, element);
    }

    public boolean add(T o) {
        return arrayData.add(o);
    }

    public void add(int index, T element) {
        arrayData.add(index, element);
    }

    public T remove(int index) {
        return arrayData.remove(index);
    }

    public boolean remove(T o) {
        return arrayData.remove(o);
    }

    public void clear() {
        arrayData.clear();
    }

    public boolean addAll(Collection<? extends T> c) {
        return arrayData.addAll(c);
    }

    public boolean addAll(int index, Collection<? extends T> c) {
        return arrayData.addAll(index, c);
    }

    public boolean removeAll(Collection<? extends T> c) {
        return arrayData.removeAll(c);
    }

    public Iterator<T> iterator() {
        return arrayData.iterator();
    }

    public ListIterator<T> listIterator() {
        return arrayData.listIterator();
    }
}
